package org.marsdonne.audits;

import com.fasterxml.jackson.databind.JsonNode;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * （用户交互）操作事件
 */
@Getter
@Setter
public class Operated implements Serializable {
    private String operator;
    private Date dateOperated;
    private String endpoint; //接入端，如app/小程序/h5pc等等
    private String function; //用户功能
    private String command;  //操作指令
    private JsonNode arguments; //操作参数
    private String serviceId; //发起审计的服务标识

    public Operated(String endpoint, String operator, String function, String command, JsonNode arguments) {
        this.endpoint = endpoint;
        this.operator = operator;
        this.function = function;
        this.command = command;
        this.arguments = arguments;
        this.dateOperated = new Date();
    }
}
